import React,{Fragment,useEffect } from 'react'
import { Form, Input, Button } from 'antd';
import 'antd/dist/antd.css'

const ListItem = (props)=>{
    console.log(props)
    useEffect(()=>{
        console.log(props.count)
        return()=>{
            console.log('当组件被清除的时候',props.count)
        }
    },[props.count])
    return(
        <Fragment>
            <Form>
                <Form.Item name="inputName" lable="name">
                    <Input placeholder={props.count}/>
                </Form.Item>
                <Form.Item name="inputName" label="password">
                    <Input.Password placeholder="input password" />
                </Form.Item>
                <Button danger onClick={()=>{props.getCount(props.count + 1)}}>点击</Button>
            </Form>
        </Fragment>
    )
}

export default ListItem;